#define _CRT_SECURE_NO_WARNINGS
#include"string.h"
namespace My_string
{
	void test_string1()
	{
		string s1("hello world");
		string s2("abcdefg");
		string s3;
		s3 = s1;
		cout << s1.c_str() << endl;
		cout << s2.c_str() << endl;
		cout << s3.c_str() << endl;

	}
	void test_string2()
	{
		string s1("hello world");
		for (auto e : s1)
		{
			cout << e << " ";
		}
		cout << endl;
		string::iterator it1 = s1.begin();
		 while(it1 != s1.end())
		{
			cout << *it1 << " ";
			it1++;
		}
		 cout << endl;
		 cout << s1.size();
	}
	void test_string3()
	{
		string s1("hello world");
		for (auto e : s1)
		{
			cout << e ;
		}
		cout << endl;
		s1.push_back('a');
		for (auto e : s1)
		{
			cout << e  ;
		}

	}
	void test_string4()
	{
		string s1("hello world");
		string s2("abcdefg");
		s1.append(s2.c_str());
		for (auto e : s1)
		{
			cout << e;
		}
	}
	void test_string5()
	{
		string s1("hello world");
		s1.insert(0, '!');
		for (auto e : s1)
		{
			cout << e;
		}
	}
	void test_string6()
	{
		string s1("hello world");
		
		cout << s1.find('o', 0);
	}

}

int main()
{
	My_string::test_string6();

	return 0;
}